@extends('admin::layouts.master')
@section('content')
    <div class="modal-header">
        <h3 id="ModalLabel">{{ $title }}</h3>
    </div>
    <div class="modal-header">
        {{ Form::open(array( 'url' => $packageAdmin.'/admin/category',
                             'method'  => 'post',
                             'role'    => 'form' ,
                             'class'   => 'form-inline'))}}
             <div class="form-group">
                 {{ Form::input('text', 'keySearch', $data['keySearch'], array('placeholder' => 'Category name', 'class' => 'form-control')) }}
             </div>

             {{ Form::reset('Reset', array('class' => 'btn btn-default')) }}
             {{ Form::submit('Search', array('class' => 'btn btn-primary')) }}

        {{ Form::close()}}
    </div>
    <div class="modal-body">
        <div class="table-responsive">
        <div class="box">
        {{ $categories->links() }}
        </div>
        <table class="table-responsive table table-bordered table-striped table-hover">
            <tr>
                <th></th>
                <th>ID</th>
                <th>Category name</th>
                <th>Category description</th>
                <th>Status</th>
                <th>Created</th>
                <th>Updated</th>
                <th>Tool</th>
            </tr>
            @foreach($categories as $key => $category)
                <tr>
                    <td>{{ $key + 1 }}</td>
                    <td>{{ $category->id }}</td>
                    <td>{{ $category->category_name }}</td>
                    <td>{{ $category->category_description }}</td>
                    <td>{{  HTML::image(URL::to('/public').($category->status ? '/images/active.png' : '/images/inactive.png'), '', array('width' => '16', 'class' => 'status', 'data-id' => $category->id, 'data-model' => 'category'));}}</td>
                    <td>{{ date('F j, Y, g:i A', strtotime($category->created_at)) }}</td>
                    <td>{{ date('F j, Y, g:i A', strtotime($category->updated_at)) }}</td>
                    <td>
                        {{ html_entity_decode(HTML::linkRoute('category/edit', HTML::image(URL::to('/public/images/edit.png'), '', array('width' => '16')), array('id' => $category->id))) }}
                        {{ html_entity_decode(HTML::linkRoute('category/delete', HTML::image(URL::to('/public/images/delete.gif'), '', array('width' => '16')), array('id' => $category->id))) }}
                        {{ html_entity_decode(HTML::linkRoute('category/view', HTML::image(URL::to('/public/images/view.gif'), '', array('width' => '16')), array('id' => $category->id))) }}
                    </td>
                </tr>
            @endforeach
        </table>
        {{ $categories->links() }}
        </div>
    </div>
    <div class="modal-footer">
    </div>
@stop